wintab tilt: Check return location for validity
authorAndrew Chadwick <a.t.chadwick@gmail.com>
Tue, 22 Nov 2016 10:28:40 +0000 (10:28 +0000)
committerIgnacio Casal Quinteiro <icq@gnome.org>
Tue, 22 Nov 2016 11:16:19 +0000 (12:16 +0100)
https://bugzilla.gnome.org/show_bug.cgi?id=774265

gdk/win32/gdkdevicemanager-win32.c

index f88dab78bdc8a35eba4765c74f772bc081f33051..cd63a77f788750ce7613df892fb6ebe23e3010cf 100644 (file)
@@ -800,6 +800,8 @@ decode_tilt (gint   *axis_data,
 {
   double az, el;
 
+  g_return_if_fail (axis_data != NULL);
+
   /* The wintab driver for the Wacom ArtPad II reports
    * PK_ORIENTATION in CSR_PKTDATA, but the tablet doesn't
    * actually sense tilt. Catch this by noticing that the
@@ -810,7 +812,7 @@ decode_tilt (gint   *axis_data,
    * sensible tilts will need both, so only add the GDK tilt axes
    * if both wintab axes are going to be well-behaved in use.
    */
-  if ((axes == NULL) || (axis_data == NULL) ||
+  if ((axes == NULL) ||
       (axes[0].axResolution == 0) ||
       (axes[1].axResolution == 0))
     {